package cn.hls.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * @fileName: Member.java
 * @package: cn.hls.entity
 * @Description: 车辆基本信息
 * @author: yinghui.zhang
 * @email: uuhui@163.com
 * @date: 2016-06-02
 */
@Table(name = "t_car")
@Entity
@DynamicInsert
@DynamicUpdate
public class Car extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String licenseNum;// 车牌号
	private String licenseColor;// 车牌颜色
	private String carColor;// 车辆颜色
	private String licenseNum2;// 挂车号
	private Integer lengthSize;// 车辆长度 单位MM
	private Integer widthSize;// 车辆宽度 单位MM
	private Integer highSize;// 车辆高度 单位MM
	private Float carryCapacity;// 载重量
	private Float curbWeight;// 准备质量 单位Kg
	private Float ttMass;// 准牵引总质量或挂车总质量 单位Kg
	private Float tankVolume;// 罐体容积
	private String tankMaterial;// 罐体材质
	private Date transLicenseValidityTime;// 道路运输证件有效期
	private Date driveValidityTime;// 行驶证有效期
	private CarCategory carCategory;// 车辆类型
	private Integer carType;// 车辆类型 1-自有 2-挂靠 3-社会
	private String transLicenseNum;// 道路运输许可证
	private String bussinessScope;// 经营范围
	private Date forcedInsuranceTime;// 强制保险有效日期
	private Date thirdInsuranceTime;// 第三责任险有效日期
	private Date carrierInsuranceTime;// 承运人责任险有效日期
	private Date driveExamTime;// 驾驶证年审有效期
	private Date transLicenseExamTime;// 道路运输证年审有效期
	private Date secondMaintenanceTime;// 二级维护有效期
	private String satelliteSupplier;// 卫星定位运营商
	private Date techicalGradeTime;// 技术评级有效期
	private Date tankExamTime;// 罐体年检有效期
	private Member driver;// 驾驶员
	private Member escort;// 押运员
	private String remark;// 备注
	private Company company;// 企业编号

	private String searchAttribute;// 查询属性

	@Column(name = "license_num", length = 8)
	public String getLicenseNum() {
		return licenseNum;
	}

	public void setLicenseNum(String licenseNum) {
		this.licenseNum = licenseNum;
	}

	@Column(name = "license_num2", length = 8)
	public String getLicenseNum2() {
		return licenseNum2;
	}

	public void setLicenseNum2(String licenseNum2) {
		this.licenseNum2 = licenseNum2;
	}

	@Column(name = "carry_capacity")
	public Float getCarryCapacity() {
		return carryCapacity;
	}

	public void setCarryCapacity(Float carryCapacity) {
		this.carryCapacity = carryCapacity;
	}

	@Column(name = "trans_license_num", length = 32)
	public String getTransLicenseNum() {
		return transLicenseNum;
	}

	public void setTransLicenseNum(String transLicenseNum) {
		this.transLicenseNum = transLicenseNum;
	}

	@Column(name = "license_color", length = 1)
	public String getLicenseColor() {
		return licenseColor;
	}

	public void setLicenseColor(String licenseColor) {
		this.licenseColor = licenseColor;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "driver_id")
	public Member getDriver() {
		return driver;
	}

	public void setDriver(Member driver) {
		this.driver = driver;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "escort_id")
	public Member getEscort() {
		return escort;
	}

	public void setEscort(Member escort) {
		this.escort = escort;
	}

	@Column(name = "remark", length = 100)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "company_id")
	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "CATEGORY_ID")
	public CarCategory getCarCategory() {
		return carCategory;
	}

	public void setCarCategory(CarCategory carCategory) {
		this.carCategory = carCategory;
	}

	@Column(name = "car_type", length = 1, columnDefinition = "char default 1")
	public Integer getCarType() {
		return carType;
	}

	public void setCarType(Integer carType) {
		this.carType = carType;
	}

	@Column(name = "bussiness_scope", length = 100)
	public String getBussinessScope() {
		return bussinessScope;
	}

	public void setBussinessScope(String bussinessScope) {
		this.bussinessScope = bussinessScope;
	}

	@Column(name = "forced_insurance_time")
	public Date getForcedInsuranceTime() {
		return forcedInsuranceTime;
	}

	public void setForcedInsuranceTime(Date forcedInsuranceTime) {
		this.forcedInsuranceTime = forcedInsuranceTime;
	}

	@Column(name = "third_insuance_time")
	public Date getThirdInsuranceTime() {
		return thirdInsuranceTime;
	}

	public void setThirdInsuranceTime(Date thirdInsuranceTime) {
		this.thirdInsuranceTime = thirdInsuranceTime;
	}

	@Column(name = "carrier_insurance_time")
	public Date getCarrierInsuranceTime() {
		return carrierInsuranceTime;
	}

	public void setCarrierInsuranceTime(Date carrierInsuranceTime) {
		this.carrierInsuranceTime = carrierInsuranceTime;
	}

	@Column(name = "trans_license_exam_time")
	public Date getTransLicenseExamTime() {
		return transLicenseExamTime;
	}

	public void setTransLicenseExamTime(Date transLicenseExamTime) {
		this.transLicenseExamTime = transLicenseExamTime;
	}

	@Column(name = "driver_exam_time")
	public Date getDriveExamTime() {
		return driveExamTime;
	}

	public void setDriveExamTime(Date driveExamTime) {
		this.driveExamTime = driveExamTime;
	}

	@Column(name = "second_maintenance_time")
	public Date getSecondMaintenanceTime() {
		return secondMaintenanceTime;
	}

	public void setSecondMaintenanceTime(Date secondMaintenanceTime) {
		this.secondMaintenanceTime = secondMaintenanceTime;
	}

	@Column(name = "statellite_supplier", length = 100)
	public String getSatelliteSupplier() {
		return satelliteSupplier;
	}

	public void setSatelliteSupplier(String satelliteSupplier) {
		this.satelliteSupplier = satelliteSupplier;
	}

	@Column(name = "techical_grade_time")
	public Date getTechicalGradeTime() {
		return techicalGradeTime;
	}

	public void setTechicalGradeTime(Date techicalGradeTime) {
		this.techicalGradeTime = techicalGradeTime;
	}

	@Column(name = "tank_exam_Time")
	public Date getTankExamTime() {
		return tankExamTime;
	}

	public void setTankExamTime(Date tankExamTime) {
		this.tankExamTime = tankExamTime;
	}

	@Column(name = "car_color", length = 5)
	public String getCarColor() {
		return carColor;
	}

	public void setCarColor(String carColor) {
		this.carColor = carColor;
	}

	@Column(name = "length_size")
	public Integer getLengthSize() {
		return lengthSize;
	}

	public void setLengthSize(Integer lengthSize) {
		this.lengthSize = lengthSize;
	}

	@Column(name = "width_size")
	public Integer getWidthSize() {
		return widthSize;
	}

	public void setWidthSize(Integer widthSize) {
		this.widthSize = widthSize;
	}

	@Column(name = "high_size")
	public Integer getHighSize() {
		return highSize;
	}

	public void setHighSize(Integer highSize) {
		this.highSize = highSize;
	}

	@Column(name = "curb_weight")
	public Float getCurbWeight() {
		return curbWeight;
	}

	public void setCurbWeight(Float curbWeight) {
		this.curbWeight = curbWeight;
	}

	@Column(name = "tt_mass")
	public Float getTtMass() {
		return ttMass;
	}

	public void setTtMass(Float ttMass) {
		this.ttMass = ttMass;
	}

	@Column(name = "tank_volume")
	public Float getTankVolume() {
		return tankVolume;
	}

	public void setTankVolume(Float tankVolume) {
		this.tankVolume = tankVolume;
	}

	@Column(name = "tank_material", length = 20)
	public String getTankMaterial() {
		return tankMaterial;
	}

	public void setTankMaterial(String tankMaterial) {
		this.tankMaterial = tankMaterial;
	}

	@Column(name = "transLicense_Validity_Time")
	public Date getTransLicenseValidityTime() {
		return transLicenseValidityTime;
	}

	public void setTransLicenseValidityTime(Date transLicenseValidityTime) {
		this.transLicenseValidityTime = transLicenseValidityTime;
	}

	@Column(name = "drive_validity_time")
	public Date getDriveValidityTime() {
		return driveValidityTime;
	}

	public void setDriveValidityTime(Date driveValidityTime) {
		this.driveValidityTime = driveValidityTime;
	}

	@Transient
	@JsonIgnore
	public String getSearchAttribute() {
		return searchAttribute;
	}

	public void setSearchAttribute(String searchAttribute) {
		this.searchAttribute = searchAttribute;
	}

}
